Models may be used to simulate physical systems. For example, a graphical model may be used to represent a complex control system for a plant. The graphical model may include entities, such as blocks, that reference executable code for performing operations of the control system when the graphical model executes. The blocks can vary in type and/or number and may be connected together to build large, complex models (e.g., models including hundreds or more interconnected blocks).
Blocks can include function calls that perform an operation when the function of the block is executed. One way of representing function calls in a model is via function-call subsystem block. Function-call subsystem blocks may simplify a model by allowing multiple blocks and/or operations to be represented via a single block referred to as a function-call subsystem.
When a model includes more than one function-call subsystem, a technique may be required for executing the function-call subsystems in a determined order. Since graphical models support single threaded execution, a first function-call subsystem may need to execute on a main thread before a second function-call subsystem can execute. Conventional techniques may use a function-call generator block to inform function-call subsystems as to when to execute on the main thread to support serial execution of the model.
As models become large and/or complex, serial model execution on a single thread may not take advantage of available multi-processing capabilities and may produce undesirably long model execution times.